//
//  XWXSqliteQueryCommand.h
//  XWXSqlite
//
//  Created by 许卫星 on 17/9/4.
//  Copyright © 2017年 wxxu. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSUInteger, ColumnNameToValueRelationType) {
    ColumnNameToValueRelationTypeMore,      // >
    ColumnNameToValueRelationTypeLess,      // <
    ColumnNameToValueRelationTypeEqual,     // =
    ColumnNameToValueRelationTypeMoreEqual, // >=
    ColumnNameToValueRelationTypeLessEqual, // <=
};

typedef NS_ENUM(NSUInteger, ColumnNameToValueLogicType) {
    ColumnNameToValueLogicTypeNot,       // NOT
    ColumnNameToValueLogicTypeAnd,   // AND
    ColumnNameToValueLogicTypeOr,    // OR
};

typedef NS_ENUM(NSUInteger, ColumnValueRelationType) {
    ColumnValueRelationTextType,      // 不需要加引号
    ColumnValueRelationDataType,      // 需要加引号
};

@class XWXSqliteDataBase;
@interface XWXSqliteQueryCommand : NSObject


/**
 *  要执行的sql
 */
@property (nonatomic, strong, readonly) NSMutableString *sqlString;

/**
 *  操作的数据库
 */
@property (nonatomic, weak, readonly) XWXSqliteDataBase *database;

/**
 根据数据库名称创建Sql对象
 @param databaseName 数据库名称
 @return Sql对象
 */
- (instancetype)initWithDatabaseName:(NSString *)databaseName;


/**
 根据数据库创建Sql对象
 @param database 数据库
 @return Sql对象
 */
- (instancetype)initWithDatabase:(XWXSqliteDataBase *)database;


/**
 清除sql语句
 @return Sql对象
 */
- (instancetype)resetQueryCommand;

@end
